package com.zka.crm.workbench.service.Impl;

import com.zka.crm.workbench.domain.Activities;
import com.zka.crm.workbench.mapper.ActivitiesMapper;
import com.zka.crm.workbench.service.ActivityService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("activityService")
public class ActivityServiceImpl implements ActivityService {
    private final ActivitiesMapper activitiesMapper;

    public ActivityServiceImpl(ActivitiesMapper activitiesMapper) {
        this.activitiesMapper = activitiesMapper;
    }

    @Override
    public int saveActivity(Activities activities) {
        return activitiesMapper.insertActivity(activities);
    }

    @Override
    public List<Activities> queryActivityByConditionForPage(Map<String, Object> map) {
        return activitiesMapper.selectActivityByConditionForPage(map);
    }

    @Override
    public int queryCountOfActivityByConditionForPage(Map<String, Object> map) {
        return activitiesMapper.selectCountOfActivityByConditionForPage(map);
    }

    @Override
    public int deleteActivityByIds(String[] ids) {
        return activitiesMapper.deleteActivityByIds(ids);
    }

    @Override
    public Activities queryActivityById(String id) {
        return activitiesMapper.selectActivityById(id);
    }

    @Override
    public int updateActivityById(Activities activity) {
        return activitiesMapper.updateActivityById(activity);
    }

}
